package com.wanlong.admin.controller;

import com.wanlong.common.result.ResponseResult;
import com.wanlong.rpc.service.SysMemberManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import redis.clients.jedis.JedisPool;

import java.util.ArrayList;
import java.util.List;


@Controller
@RequestMapping(value = "/")
public class IndexController {

    @Autowired
    private JedisPool jedisPool;

    @Autowired
    public SysMemberManagerService sysMemberManagerService;

    @RequestMapping(value = "/index" , method = RequestMethod.GET)
    @ResponseBody
    public String index(){
//        Jedis jedis = jedisPool.getResource();
//        jedis.set("webapp","wanlong");
//        System.out.println(sysMemberManagerService.getPageSysUserListByName("",1,10));
        return "hello";//+jedis.get("webapp")
    }

    @RequestMapping(value = "/test" ,method = RequestMethod.GET)
    @ResponseBody
    public ResponseResult testResponse(){
        List<String> test=new ArrayList<>();
        test.add("测试一");
        test.add("test1");

        return ResponseResult.success(test);

    }
}
